package com.ming.user.mq.produce;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Classname UserMqController
 * @Description TODO
 * @Date 2021/1/13 16:31
 * @Created by yanming.fu
 */
@Slf4j
@RestController
public class UserMqProduce {

  /*  @Resource
    private ProducerBean producerBean;


    public void sentMsg(){
        //发送mq通知
        JxStudySource jxStudySource = JxStudySource.builder().classId(1).paperId(2).userId(3L).build();

        Message msg =new Message(MqParamMapper.getProperty("user").getTopic(), MqParamMapper.getProperty("user").getTag(), JsonUtil.toJson(jxStudySource).getBytes());
        //key 用户发送失败后 在控制台重新发送
        msg.setKey(UUID.randomUUID().toString());
        SendResult sendResult = null;
        try {
            sendResult = producerBean.send(msg);
            if (sendResult != null) {
                log.info("send  success : {}", sendResult.getMessageId());
            }
        } catch (ONSClientException e) {
            log.info("send   fails : topic{} tag{}", msg.getTopic(), msg.getTag());
        }

    }*/
}
